package net.zrnecko.bowlingnumbers.session;

import net.zrnecko.bowlingnumbers.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.List;
import java.util.Arrays;

@Name("tagList")
public class TagList extends EntityQuery {

	private static final String[] RESTRICTIONS = {"lower(tag.tag) like concat(lower(#{tagList.tag.tag}),'%')",};

	private Tag tag = new Tag();

	@Override
	public String getEjbql() {
		return "select tag from Tag tag";
	}

	@Override
	public Integer getMaxResults() {
		return 25;
	}

	public Tag getTag() {
		return tag;
	}

	@Override
	public List<String> getRestrictions() {
		return Arrays.asList(RESTRICTIONS);
	}

}
